package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.zr.dao.TjsqDao;
import com.zr.util.JDBCUtil;

public class TjsqDaoImpl implements TjsqDao{

	@Override
	public boolean getTjsq(String edata, String etartday, int actualday,
			String category, String reason, String opinion,
			int eid, String remake) {
		boolean b=false;
		StringBuffer sql=new StringBuffer("INSERT INTO vacation ");
		sql.append(" (edata,etartday,actualday,category,reason,opinion,eid,remake,state) ");
		sql.append(" VALUES(?,?,?,?,?,?,?,?,'待审核')");
		Connection con=JDBCUtil.getConnection();
		try {
			PreparedStatement pst=con.prepareStatement(sql.toString());
			pst.setString(1, edata);
			pst.setString(2, etartday);
			pst.setInt(3, actualday);
			pst.setString(4, category);
			pst.setString(5,reason );
			pst.setString(6, opinion);
			pst.setInt(7, eid);
			pst.setString(8, remake);
			int i=pst.executeUpdate();
			if(i>0){
				b=true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return b;
	}

}
